﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using HiLand.General.Entity;
using HiLand.General.BLL;
using HiLand.Utility.Enums;
using GBFinance.Web.Models;

namespace GBFinance.Web.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            PassLoanSetting();
            return View();
        }



        public ActionResult About()
        {
            return View();
        }

        public ActionResult Faqs()
        {
            return View();
        }

        [ActionName("Contact-Us")]
        public ActionResult ContactUs()
        {
            return View("ContactUs");
        }

        [ActionName("How-It-Works")]
        public ActionResult HowItWorks()
        {
            return View("HowItWorks");
        }

        [ActionName("Unsecured-Loans-Calculator")]
        public ActionResult UnsecuredLoansCalculator()
        {
            return View("UnsecuredLoansCalculator");
        }

        [ActionName("Secured-Loans-Calculator")]
        public ActionResult SecuredLoansCalculator()
        {
            return View("SecuredLoansCalculator");
        }

        [ActionName("Unsecured-Loans")]
        public ActionResult UnsecuredLoans()
        {
            PassLoanSetting();
            return View("UnsecuredLoans");
        }

        [ActionName("Secured-Loans")]
        public ActionResult SecuredLoans()
        {
            PassLoanSetting();
            return View("SecuredLoans");
        }

        [ActionName("Payroll-Finance")]
        public ActionResult PayrollFinance()
        {
            return View("PayrollFinance");
        }

        #region 辅助方法
        /// <summary>
        /// 向页面传递贷款设置信息
        /// </summary>
        private void PassLoanSetting()
        {
            LoanBasicSetting loanBasicSetting = new LoanBasicSetting();
            decimal SecuredLoansAmountMin = loanBasicSetting.SecuredLoansAmountMin;
            this.ViewData["SecuredLoansAmountMin"] = SecuredLoansAmountMin;

            decimal SecuredLoansAmountMax = loanBasicSetting.SecuredLoansAmountMax;
            this.ViewData["SecuredLoansAmountMax"] = SecuredLoansAmountMax;

            decimal UnSecuredLoansAmountMin = loanBasicSetting.UnSecuredLoansAmountMin;
            this.ViewData["UnSecuredLoansAmountMin"] = UnSecuredLoansAmountMin;

            decimal UnSecuredLoansAmountMax = loanBasicSetting.UnSecuredLoansAmountMax;
            this.ViewData["UnSecuredLoansAmountMax"] = UnSecuredLoansAmountMax;
        }
        #endregion
    }
}
